package com.im.service.meteDeclare.smo;

import com.im.service.dto.MeteDeclare;
import com.im.service.meteDeclare.dao.IMeteDeclareOperDAO;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class MeteDeclareOperSMOImpl implements IMeteDeclareOperSMO {

    private static final Logger logger = LogManager.getLogger(MeteDeclareOperSMOImpl.class);

    @Autowired
    private IMeteDeclareOperDAO meteDeclareOperDAO;

    @Override
    public void addMeteDeclare(MeteDeclare meteDeclare) throws Exception{
        String declareId =UUID.randomUUID().toString();
        meteDeclare.setDeclareId(declareId);
        meteDeclareOperDAO.addMeteDeclare(meteDeclare);
    }

    @Override
    public void updateMeteDeclare(MeteDeclare meteDeclare) throws Exception{
        meteDeclareOperDAO.updateMeteDeclare(meteDeclare);
    }

    @Override
    public void deleteMeteDeclare(MeteDeclare meteDeclare) throws Exception{
        meteDeclareOperDAO.deleteMeteDeclare(meteDeclare);
    }
}
